package version

import (
	"fmt"
	"github.com/spf13/cobra"
	"log"
)

var VersionCmd = &cobra.Command{
	Use:   "cobra [string to action]",
	Short: "cobra command tool",
	Long:  "cobra is a simple cli command tool",
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		log.Println("1. rootCmd PersistentPreRun")
	},
	PreRun: func(cmd *cobra.Command, args []string) {
		log.Println("2. rootCmd PreRun")
		//setup()
	},
	Run: func(cmd *cobra.Command, args []string) {
		log.Println("3. rootCmd Run, auth: huangjinjin")
		run()
	},
	PostRun: func(cmd *cobra.Command, args []string) {
		log.Println("4. rootCmd PostRun")
	},
	PersistentPostRun: func(cmd *cobra.Command, args []string) {
		log.Println("5. rootCmd PersistentPostRun")
	},
}

func run() {
	fmt.Println("use version cmd")
}
